package br.unifesp.lma.chamada.controller;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/")
public class IndexController {

	@RequestMapping(method = GET)
	public String index(HttpSession httpSession, Model uiModel, String url) {
		
		if (httpSession.getAttribute("professorId") != null) {
			return "redirect:/web/listar-disciplinas";
		} else {
			uiModel.addAttribute("url", url);
			return "redirect:/sobre";
		}
	}
}
